package br.usp.pcs.basys.engine;

import java.util.Date;

import br.usp.pcs.basys.event.DiskRequest;
import br.usp.pcs.basys.event.Event;
import br.usp.pcs.basys.event.MemoryRequest;
import br.usp.pcs.basys.event.ProcessorRequest;

public interface IResources {

	public abstract Date getSimulationDate();

	public abstract void setSimulationDate(Date simulationDate);

	public abstract void allocate(long size) throws UnavaiableResourceException;

	public abstract void deallocate(long size);

	public abstract boolean queue(MemoryRequest e);

	public abstract MemoryRequest pollMemoryQueue();

	public abstract boolean add(Event e);

	public abstract Event getNextEvent();

	public abstract void setMemory(Memory memory);

	public abstract void releaseProcessor();

	public abstract void reserveProcessor() throws UnavaiableResourceException;

	public abstract void releaseDisk();

	public abstract void reserveDisk() throws UnavaiableResourceException;

	public abstract boolean queue(ProcessorRequest e);

	public abstract ProcessorRequest pollProcessorQueue();

	public abstract boolean queue(DiskRequest e);

	public abstract DiskRequest pollDiskQueue();

}